import {Http} from '@angular/http';
import {Component, Output, EventEmitter}  from '@angular/core';
import { Notify } from "app/Service";

/**
 * 图标编辑区域组件
 */
@Component({
	selector: ".login_pane",
	templateUrl: 'template/app/login.html'
})
export class LoginComp {
	secCode:string = "2343";
	username:string = "18779862404";
	password:string = "123123";
	
	constructor(private http:Http, private notify:Notify){}
	
	@Output() loginSuccess = new EventEmitter<boolean>();
	
	/**
	 * 登录接口
	 */
	login(){
		this.http.get({
			search:{
				m:"Admin",
				c:"ApiAdmin",
				a:"adminLogin",
				name:this.username,
				password:this.password
			}
		}).then((data)=>{
			this.loginSuccess.emit(true);
			this.notify.emit(true);
		})
	}
}